package com.ffyc.cemp.tools;

import cn.hutool.core.codec.Base64;

import java.io.InputStream;

public enum Base64UtilX {
    INSTANCE;

    /**
     * 将流转换为base64字符串
     * @param in
     * @return
     */
    public String encode(InputStream in,String type) {
        String str = Base64.encode(in);
        str = String.format("data:image/%s;base64,%s", type, str);
        return str;
    }
}
